
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.prime.com.tr/ui">

<h:head>
	<title>Cadastro de Cliente Pessoa Fisica</title>

</h:head>

<h:body>
	<h:form id="formfisica">

		<p:growl id="mensagemConfirmacao" />

		<p:wizard backLabel="Anterior" nextLabel="Proximo" flowListener="#{fisicaAction.onFlowProcess}">

			<p:tab id="personal" title="Pessoal">

				<ui:include src="/cadastrofisica/dadospessoais.xhtml" />

			</p:tab>


			<p:tab id="address" title="Endereço">

				<ui:include src="/cadastrofisica/dadosendereco.xhtml" />


			</p:tab>

			<p:tab id="contact" title="Contato">
				<ui:include src="/cadastrofisica/dadoscontato.xhtml" />
			</p:tab>

			<p:tab id="confirm" title="Confirmar">
				<p:panel header="Confirmação">

					<p:growl id="growl" sticky="true" showDetail="true" />

					<h:panelGrid id="confirmation" columns="6">
						<h:outputText value="Nome Completo:" />
						<h:outputText styleClass="outputLabel"
							value="#{fisicaAction.fisica.nomePessoa}" />

						<h:outputText value="Cpf: " />
						<h:outputText styleClass="outputLabel"
							value="#{fisicaAction.fisica.cpf}" />

						<h:outputText value="Data de Nascimento: " />
						<h:outputText styleClass="outputLabel"
							value="#{fisicaAction.fisica.dataNascimento}" />

						<h:outputText value="Logradouro: " />
						<h:outputText styleClass="outputLabel"
							value="#{fisicaAction.fisica.endereco.nomeRua}" />



						<h:outputText value="Email: " />
						<h:outputText styleClass="outputLabel"
							value="#{fisicaAction.fisica.email}" />

						<h:outputText value="Telefone Residencial: " />
						<h:outputText styleClass="outputLabel"
							value="#{fisicaAction.fisica.telefoneResidencial}" />

						<h:outputText value="Telefone Celular: " />
						<h:outputText styleClass="outputLabel"
							value="#{fisicaAction.fisica.telefoneCelular}" />

						<h:outputText />
						<h:outputText />
					</h:panelGrid>
					<!-- Botao cancelado-->
					<p:commandButton id="salvar" value="Salvar" update="growl"
						rendered="false" actionListener="#{fisicaAction.salvarFisica}" />
					<p:message for="salvar" />
					<!-- Botao cancelado -->

					<p:commandButton id="salvarFisica" value="Salvar"
						onclick="confirmation.show()" type="button" />

					<p:confirmDialog message="Confirma a gravação dos dados?"
						modal="true" hideEffect="explode" header="Confirmação"
						severity="alert" widgetVar="confirmation">

						<p:commandButton value="Sim" update="mensagemConfirmacao"
							oncomplete="confirmation.hide()"
							actionListener="#{fisicaAction.salvarFisica}"
							onclick="telaCadas.show()" ajax="false" />
						<p:commandButton value="Não" onclick="confirmation.hide()"
							type="button" />

					</p:confirmDialog>

				</p:panel>
			</p:tab>

		</p:wizard>
		<p:dialog id="telaConfirmacaoCadastro"
			rendered="#{fisicaAction.cadastraFisica}" widgetVar="telaCadas"
			width="250" height="120" header="Cliente Pessoa Fisica cadastrada"
			resizable="false" modal="true">

			<h:outputLabel value="Dados armazenados com sucesso!"
				style="color:blue;" />
			<h:panelGrid cellspacing="15">
				<p:commandButton value="Ok"
					actionListener="#{fisicaAction.redirecionePaginaCadastro}"
					oncomplete="telaCadas.hide()" />
			</h:panelGrid>


		</p:dialog>
	</h:form>
</h:body>

</html>

